/* SPDX-License-Identifier: GPL-2.0
 * Copyright (c) Huawei Technologies Co., Ltd. 2023-2023. All rights reserved.
 * Description: usbnet driver Vendor Hooks
 */

#ifdef CONFIG_VENDOR_USBNET_HOOKS
#undef TRACE_SYSTEM
#define TRACE_SYSTEM usbnet

#define TRACE_INCLUDE_PATH trace/hooks
#if !defined(_TRACE_HOOK_USBNET_H) || defined(TRACE_HEADER_MULTI_READ)
#define _TRACE_HOOK_USBNET_H
#include <linux/tracepoint.h>
#include <trace/hooks/vendor_hooks.h>

struct usbnet;
struct sk_buff;
struct usb_host_interface;
struct urb;
struct net_device;
struct skb_data;
struct ethtool_drvinfo;
struct sk_buff_head;


DECLARE_HOOK(vendor_usbnet_devnotify,
	TP_PROTO(struct net_device *net, struct usbnet *usbnet,
			struct usb_host_interface *interface, unsigned int add),
	TP_ARGS(net, usbnet, interface, add));

DECLARE_HOOK(vendor_usbnet_bind,
	TP_PROTO(struct usbnet *usbnet, uint32_t bind),
	TP_ARGS(usbnet, bind));

DECLARE_HOOK(vendor_usbnet_rxrestore,
	TP_PROTO(struct usbnet *dev, struct sk_buff *skb, int *ret),
	TP_ARGS(dev, skb, ret));

DECLARE_HOOK(vendor_usbnet_alloc_etherdev,
	TP_PROTO(struct net_device **net),
	TP_ARGS(net));

DECLARE_HOOK(vendor_usbnet_dfx,
	TP_PROTO(struct skb_data *entry, struct sk_buff	*skb,
			struct usbnet *dev, unsigned int skb_state, int *ret),
	TP_ARGS(entry, skb, dev, skb_state, ret));

DECLARE_HOOK(vendor_usbnet_update_qlen,
	TP_PROTO(struct usbnet *dev, unsigned int queue_memory),
	TP_ARGS(dev, queue_memory));

DECLARE_HOOK(vendor_usbnet_need_rxsubmit,
	TP_PROTO(unsigned int qlen, int *submit_flag),
	TP_ARGS(qlen, submit_flag));

DECLARE_HOOK(vendor_usbnet_get_reserved_info,
	TP_PROTO(struct usbnet *dev, struct ethtool_drvinfo *info),
	TP_ARGS(dev, info));

DECLARE_HOOK(vendor_set_netdevice_name,
	TP_PROTO(struct net_device *net),
	TP_ARGS(net));
#endif
/* This part must be outside protection */
#include <trace/define_trace.h>

#else

#include <linux/tracepoint.h>

struct usbnet;
struct sk_buff;
struct usb_host_interface;
struct urb;
struct net_device;
struct skb_data;
struct ethtool_drvinfo;
struct sk_buff_head;

DECLARE_EVENT_NOP(vendor_usbnet_devnotify,
	TP_PROTO(struct net_device *net, struct usbnet *usbnet,
			struct usb_host_interface *interface, unsigned int add),
	TP_ARGS(net, usbnet, interface, add));

DECLARE_EVENT_NOP(vendor_usbnet_bind,
	TP_PROTO(struct usbnet *usbnet, uint32_t bind),
	TP_ARGS(usbnet, bind));

DECLARE_EVENT_NOP(vendor_usbnet_rxrestore,
	TP_PROTO(struct usbnet *dev, struct sk_buff *skb, int *ret),
	TP_ARGS(dev, skb, ret));

DECLARE_EVENT_NOP(vendor_usbnet_alloc_etherdev,
	TP_PROTO(struct net_device **net),
	TP_ARGS(net));

DECLARE_EVENT_NOP(vendor_usbnet_dfx,
	TP_PROTO(struct skb_data *entry, struct sk_buff	*skb,
			struct usbnet *dev, unsigned int skb_state, int *ret),
	TP_ARGS(entry, skb, dev, skb_state, ret));

DECLARE_EVENT_NOP(vendor_usbnet_update_qlen,
	TP_PROTO(struct usbnet *dev, unsigned int queue_memory),
	TP_ARGS(dev, queue_memory));

DECLARE_EVENT_NOP(vendor_usbnet_need_rxsubmit,
	TP_PROTO(unsigned int qlen, int *submit_flag),
	TP_ARGS(qlen, submit_flag));

DECLARE_EVENT_NOP(vendor_usbnet_get_reserved_info,
	TP_PROTO(struct usbnet *dev, struct ethtool_drvinfo *info),
	TP_ARGS(dev, info));

DECLARE_EVENT_NOP(vendor_set_netdevice_name,
	TP_PROTO(struct net_device *net),
	TP_ARGS(net));

#endif  /* CONFIG_VENDOR_USBNET_HOOKS */
